package cn.lili.controller;


import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.share.entity.docs.AppUser;
import cn.lili.modules.share.entity.dto.AppUserDTO;
import cn.lili.modules.share.entity.dto.AppUserStatistics;
import cn.lili.modules.share.service.AppUserService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户信息控制器
 * </p>
 *
 * @author admin
 * @since 2024-03-21
 */
@RestController
@Api("AppUserController-用户信息控制器")
@RequestMapping("/share/appuser")
@RequiredArgsConstructor
public class AppUserController {

    private final AppUserService appUserService;

    @GetMapping("/myInviteList")
    @ApiOperation("我的邀请列表")
    public ResultMessage<Page<AppUser>> myInviteList(AppUserDTO appUserDTO) {
        return ResultUtil.data(appUserService.myInviteList(appUserDTO));
    }


    @GetMapping("/myRanking")
    @ApiOperation("排名列表")
    public ResultMessage<AppUserStatistics> myRanking(AppUserDTO appUserDTO) {
        return ResultUtil.data(appUserService.myRanking(appUserDTO));
    }

    @GetMapping("/myInviteStatistics")
    @ApiOperation("我的邀请统计")
    public ResultMessage<AppUserStatistics> myInviteStatistics(AppUserDTO dto) {
        return ResultUtil.data(appUserService.myInviteStatistics(dto));
    }
}
